import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
const _import = require('./_import_' + process.env.NODE_ENV);


Vue.use(Router)

const routes = [{
    path: '/',
    redirect: '/home',
    component: _import('home/Index'),
    children: [{
      path: '/home',
      name: '首页',
      component: _import('home/Index')
    }, ]
  },
  {
    path: '/order',
    name: '订单列表',
    component: _import('order/Index'),
    children: [{
      path: 'orderDetails',
      name: '订单详情',
      component: _import('order/OrderDetails')
    }]

  },
  // {
  //   path: '/order/orderDetails',
  //   name: '订单详情',
  //   component: _import('order/OrderDetails')
  // },
  {
    path: '/vuexTest',
    name: 'vuex学习',
    component: _import('vuexTest/Index')
  }

];

export default new Router({
  mode: 'history', // 去掉#
  routes: routes
})
